package com.lh.tams.dao.factory;

import org.hibernate.Session;
import org.hibernate.Transaction;

import com.lh.tams.domain.Countryinfo;

public class HibernateTest {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Session session = HibernateSessionFactory.getSession();  
	    Transaction tx = session.beginTransaction();  
	    Countryinfo country=new Countryinfo("00001", "JPA", 1);  
	    try {  
	        session.save(country);  
	        tx.commit();  
	    } catch (Exception e) {  
	        tx.rollback();  
	        e.printStackTrace();  
	    }finally{  
	        session.close();  
	    }  

	}

}
